﻿@model Zor_Web.Models.Stat.V_TaxRevenueStat
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>税收统计表</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <script src="~/Content/laydate/laydate.js"></script>

</head>
<body class="gray-bg">
    <div class="layui-tab layui-tab-brief main-tab-container ">
        <div class="col-sm-12 ct-padding">
            <div class="col-sm-9 ct-padding">
                <button id="btnExport" class="layui-btn layui-btn-warm layui-btn-small"><span class="glyphicon glyphicon-share"></span> 导出</button>
                <button id="btnReplace" class="layui-btn layui-btn-danger layui-btn-small"><span class="glyphicon glyphicon-refresh"></span> 刷新</button>
                <button id="btnSearch" class="layui-btn layui-btn-danger layui-btn-small"><span class="glyphicon glyphicon-search"></span> 查询</button>
            </div>
        </div>

        <div class="layui-tab-content">
            <table class="layui-table" lay-skin="line">
                <thead>
                    <tr>
                        <th hidden></th>
                        <th><input type="checkbox" name="checkAll" id="cbkCheckAll"></th>
                        <th>年月</th>
                        <th>街办</th>                       
                        <th>社区</th>
                        <th>小计(元)</th>
                    </tr>
                </thead>
                <tbody id="accordion">
                    @foreach (var item in Model.PageData)
                    {
                        <tr>
                            <td hidden>@item.Dt_Id</td>
                            <td><input type="checkbox" class="i-checks" name="chk" id="@item.Dt_Id" value="@item.Dt_Id" /></td>
                            <td>@item.Y_YearMonth</td>
                            <td>@item.Jb</td>
                            <td>@item.Dt_Name</td>
                            <td>@item.Pt_ActualTax</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>

        <div class="col-sm-12">
            <div class="col-sm-10">
                @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "bootstrappager", @class = "pagination" })
            </div>
            <div class="col-sm-2 to-righjt">
                共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
            </div>
        </div>

    </div>

    @using (Html.BeginForm("TaxRevenueStat", "Stat", new RouteValueDictionary { { "Model", Model } }, FormMethod.Get))
    {
    <!-- 查询模态框 -->
   <div id="myModalSearch" hidden data-backdrop="static">
            <div id="divselectfrom" class="layui-tab-content">
                <form class="form-horizontal m-t">
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">年月：</label>
                        <div class="col-sm-7">
                            <input id="Y_YearMonth" type="text" class="form-control" name="Y_YearMonth" value="@Model.Y_YearMonth">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">街办：</label>
                        <div class="col-sm-7">
                            <input id="Jb" type="text" class="form-control" name="Jb" value="@Model.Jb">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">社区：</label>
                        <div class="col-sm-7">
                            <input id="Dt_Name" type="text" class="form-control" name="Dt_Name" value="@Model.Dt_Name">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">小计：</label>
                        <div class="col-sm-7">
                            <input id="Pt_ActualTax" type="text" class="form-control" name="Pt_ActualTax" value="@Model.Pt_ActualTax">
                        </div>
                    </div>

                </form>
                <div class="box-footer">
                    <button type="submit" class="btn btn-info pull-right">
                        <i class="fa fa-search"></i>查询
                    </button>
                </div>
            </div>
        </div>
    }


    <!-- 导出模态 -->
    <form action="/Stat/ExportTaxRevenueStat" enctype="multipart/form-data" method="post" id="formDownload">
        <div id="exportHtml" style="display:none;">
            <div class="eh_wrap">
                <div class="eh_head">
                    <p style="">请选择您要导出的数据列</p>
                </div>
                <table width="100%" cellpadding="5" cellspacing="0">
                    <tr>
                        <td><input id="Dt_Name" type="checkbox" value="社区" name="chk_list" checked="checked" /><label>社区</label></td>
                        <td><input id="Jb" type="checkbox" value="街办" name="chk_list" checked="checked" /><label>街办</label></td>
                        <td><input id="Pt_ActualTax" type="checkbox" value="小计" name="chk_list" checked="checked" /><label>小计</label></td>

                    </tr>
                </table>
            </div>
            <div class="box-footer">
                <button type="submit" id="btnExportSure" class="btn btn-info pull-right">
                    <i class="fa fa-repeat"></i>导出
                </button>
                <input type="hidden" id="fields" name="fields" value="" />
                <input type="hidden" id="where" name="where" value="" />
            </div>
        </div>
    </form>


</body>
</html>
<script>
 
    /*查询*/

    $("#btnSearch").click(function () {      
        LayerOpen('500px', '310px', '税收统计查询', $('#myModalSearch')); //宽、高
    });

    /*导出*/
    $("#btnExport").click(function () {
        layer.open({
            type: 1,
            title: '导出提示',
            shade: false,
            skin: 'layui-layer-rim',
            area: ['620px', '205px'], //宽高
            content: $('#exportHtml')
        });
    });
    /*导出交互*/
    $("#btnExportSure").click(function () {
        var arr = new Array();
        $("[name='chk_list']").each(function () {
            if ($(this).is(":checked")) {
                arr.push($(this).attr("id") + "|" + $(this).val());
            }
        });
        $("#fields").val(arr);
        document.getElementById('formDownload').submit();
        layer.closeAll();
    });

    /**
     * 全选
     */
    $(function () {
        $("#cbkCheckAll").click(function () {
            if (this.checked) {
                $("input[name='chk']").prop('checked', true);
            } else {
                $("input[name='chk']").prop('checked', false);
            }
        })
    })
    /*刷新*/
    $("#btnReplace").click(function () {
        Replace();
    });


</script>


